package com.blog.controller.user;

import com.blog.result.Result;
import com.blog.service.UserService;
import com.blog.vo.UserVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController("userUserController")
@RequestMapping("/user/user")
@Slf4j
public class UserController {
    @Autowired
    private UserService userService;

    @GetMapping("/info/{id}")
    public Result<UserVO> infoList(@PathVariable("id") Long id) {
        log.info("获取用户信息.....");
        UserVO user = userService.listById(id);
        return Result.success(user);
    }

}
